Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed multiple artists in album not loading up #55

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

FighterBay
Copy link

Fixes the issue, #39

@@ -901,7 +901,9 @@ def albumToTracks(self, album, bId):
):
songartists = artists
else:
songartists = [Artist(name=song["artists"])]
songartists = []
for artist in song["artists"]:
Copy link
Contributor

@kmac kmac May 1, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we know if this is always a list here?

I was going to submit a pull request which checked if it's a list and falls back to the existing else, like this:

                elif type(song["artists"]) is list:
                    # handle case where we have a list of dictionaries like:
                    #   [{'name':..., 'id':...}, ]
                    songartists = [Artist(name=sa["name"])
                                   for sa in song["artists"]]
                else:
                    songartists = [Artist(name=song["artists"])]

but I am new to using this project, so I'm not sure if we need the extra check or not.

Edit: fixed my code to add multiple Artist instances, like yours. Basically I'm just wondering if we need to check it it's a list.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants